@useparagon/connect 3.1.0 → 3.2.0-experimental.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/ConnectInstallFlowClient.d.ts +21 -0
- package/dist/src/ConnectSDK.d.ts +5 -42
- package/dist/src/ConnectSDK.js +1 -1
- package/dist/src/helpers/oauth.d.ts +8 -10
- package/dist/src/index.js +1 -1
- package/dist/src/install-flow/InstallFlow.d.ts +47 -0
- package/dist/src/install-flow/InstallFlowClient.d.ts +83 -0
- package/dist/src/install-flow/derivation.d.ts +19 -0
- package/dist/src/install-flow/index.d.ts +5 -0
- package/dist/src/install-flow/index.js +2 -0
- package/dist/src/install-flow/index.js.LICENSE.txt +44 -0
- package/dist/src/install-flow/oauth.d.ts +68 -0
- package/dist/src/install-flow/salesforceInstruction.d.ts +17 -0
- package/dist/src/types/sdk.d.ts +2 -1
- package/package.json +3 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type ConnectSDK from './ConnectSDK';
|
|
2
|
+
import { CompleteSetupParams, InstallFlowClient, InstallFlowIntegrationConfig, OAuthHandlers, OAuthStartParams, SaveCredentialParams, UninstallParams } from './install-flow/InstallFlowClient';
|
|
3
|
+
/**
|
|
4
|
+
* SDK-side InstallFlowClient: delegates every operation to the host
|
|
5
|
+
* ConnectSDK's existing methods, so the SDK's install flow keeps its exact
|
|
6
|
+
* historical behavior while InstallFlow itself stays consumer-agnostic.
|
|
7
|
+
*
|
|
8
|
+
* The headless-mode gate lives in getIntegrationConfig — the first read
|
|
9
|
+
* InstallFlow performs at start() — so a non-headless SDK surfaces
|
|
10
|
+
* HeadlessModeNotEnabledError through the flow's normal onError path.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ConnectInstallFlowClient implements InstallFlowClient {
|
|
13
|
+
private readonly sdk;
|
|
14
|
+
constructor(sdk: ConnectSDK);
|
|
15
|
+
getIntegrationConfig(name: string): InstallFlowIntegrationConfig;
|
|
16
|
+
getAssetUrl(name: string): string;
|
|
17
|
+
startOAuth(params: OAuthStartParams, handlers: OAuthHandlers): void;
|
|
18
|
+
saveCredential({ integrationId, payload, installOptions }: SaveCredentialParams): Promise<import("./types").IntegrationInstallEvent | undefined>;
|
|
19
|
+
completeSetup({ integrationId, credentialId, payload, installOptions }: CompleteSetupParams): Promise<import("./types").IntegrationInstallEvent | undefined>;
|
|
20
|
+
uninstall({ integrationName, credentialId }: UninstallParams): Promise<void>;
|
|
21
|
+
}
|
package/dist/src/ConnectSDK.d.ts
CHANGED
|
@@ -4,11 +4,13 @@ import { OauthCallbackResponse } from './entities/credential.interface';
|
|
|
4
4
|
import { IConnectIntegrationWithCredentialInfo, IntegrationMetadata } from './entities/integration.interface';
|
|
5
5
|
import { PersonaMeta } from './entities/persona.interface';
|
|
6
6
|
import { ExternalFilePicker } from './file-picker/types';
|
|
7
|
+
import { InstallFlow } from './install-flow/InstallFlow';
|
|
7
8
|
import SDKEventEmitter from './SDKEventEmitter';
|
|
8
9
|
import { ConnectSdkEnvironments } from './server.types';
|
|
9
|
-
import { AccountType, AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, ConditionalSource, ConnectInputValue, Props as ConnectModalProps, ConnectParams, ConnectUser, CreateConfigurationOptions, CredentialConfigOptions, CustomDropdownField, DataType, DeleteConfigurationOptions, DisableWorkflowOptions, DynamicDataSource, DynamicDefaultInput, DynamicFieldMappingLoaderType, DynamicFieldMappingOptionsResult, EnumInputValue, EnumSection, EventInfo, GetIntegrationAccountOptions, GetTriggerTypesResponse, IConnectSDK, InputSources,
|
|
10
|
+
import { AccountType, AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, ConditionalSource, ConnectInputValue, Props as ConnectModalProps, ConnectParams, ConnectUser, CreateConfigurationOptions, CredentialConfigOptions, CustomDropdownField, DataType, DeleteConfigurationOptions, DisableWorkflowOptions, DynamicDataSource, DynamicDefaultInput, DynamicFieldMappingLoaderType, DynamicFieldMappingOptionsResult, EnumInputValue, EnumSection, EventInfo, GetIntegrationAccountOptions, GetTriggerTypesResponse, IConnectSDK, InputSources, InstallIntegrationOptions, InstallOptions, IntegrationConfig, IntegrationInstallEvent, IntentInputKeyConfig, KeyedSource, LoadCustomDropdownOptionsResult, ProxyRequestOptions, SerializedConnectInput, SetDataSourcesConfig, SingleSource, TriggerWorkflowRequest, UninstallOptions, UpdateConfigurationOptions, UpdateWorkflowStateResponse, UserProvidedIntegrationConfig } from './types';
|
|
10
11
|
export declare const PARAGON_OVERFLOW_EMPTY_VALUE = "PARAGON_OVERFLOW_EMPTY_VALUE";
|
|
11
12
|
export { ExternalFilePicker };
|
|
13
|
+
export { InstallFlow };
|
|
12
14
|
export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
13
15
|
private sdkVersion;
|
|
14
16
|
root: HTMLIFrameElement | undefined;
|
|
@@ -452,8 +454,8 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
452
454
|
*/
|
|
453
455
|
getSourcesForActionInput(input: IntentInputKeyConfig): SingleSource | ConditionalSource | null;
|
|
454
456
|
getAccountTypeOptions(integrationName: string): AccountType[];
|
|
455
|
-
getPreOptions(integrationName: string, accountTypeId?: string): IntegrationConnectInput[];
|
|
456
|
-
getPostOptions(integrationName: string): IntegrationConnectInput[];
|
|
457
|
+
getPreOptions(integrationName: string, accountTypeId?: string): import("./types").IntegrationConnectInput[];
|
|
458
|
+
getPostOptions(integrationName: string): import("./types").IntegrationConnectInput[];
|
|
457
459
|
/**
|
|
458
460
|
* fetch dynamic field mapping options (object types or integration fields)
|
|
459
461
|
*/
|
|
@@ -463,42 +465,3 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
463
465
|
search?: string;
|
|
464
466
|
}): Promise<DynamicFieldMappingOptionsResult>;
|
|
465
467
|
}
|
|
466
|
-
export declare class InstallFlow {
|
|
467
|
-
private readonly paragon;
|
|
468
|
-
private startOptions;
|
|
469
|
-
private integrationName;
|
|
470
|
-
private accountTypeValue;
|
|
471
|
-
private preOptionsValue;
|
|
472
|
-
private postOptionsValue;
|
|
473
|
-
private credentialId;
|
|
474
|
-
private hasFinishedInstruction;
|
|
475
|
-
private oauthAbortController;
|
|
476
|
-
constructor(paragon: ConnectSDK);
|
|
477
|
-
start(integrationName: string, startOptions?: StartOptions): void;
|
|
478
|
-
cancel(): Promise<void>;
|
|
479
|
-
private getInstallOptions;
|
|
480
|
-
private asyncStart;
|
|
481
|
-
private handleError;
|
|
482
|
-
private handleNext;
|
|
483
|
-
private handleComplete;
|
|
484
|
-
private getScheme;
|
|
485
|
-
private getIntegrationName;
|
|
486
|
-
private getSelectedAccountTypeOption;
|
|
487
|
-
private requiresAccountType;
|
|
488
|
-
private getIntegrationInstructionMetadata;
|
|
489
|
-
private getSalesforceInstructionMetadata;
|
|
490
|
-
private requiresInstruction;
|
|
491
|
-
private requiresPreOptions;
|
|
492
|
-
private requiresPostOptions;
|
|
493
|
-
private requiresOAuth;
|
|
494
|
-
/** Starts an OAuth authentication flow through a window Pop-up */
|
|
495
|
-
private handleOAuth;
|
|
496
|
-
setAccountType(accountType: string): Promise<void>;
|
|
497
|
-
setPreOptions(options: Record<string, ConnectInputValue>): Promise<void>;
|
|
498
|
-
setPostOptions(options: Record<string, ConnectInputValue>): Promise<void>;
|
|
499
|
-
private setHasFinishedInstruction;
|
|
500
|
-
getAccountTypeValue(): string | null;
|
|
501
|
-
getPreOptionsValue(): Record<string, ConnectInputValue> | null;
|
|
502
|
-
getPostOptionsValue(): Record<string, ConnectInputValue> | null;
|
|
503
|
-
next(): InstallFlowStage;
|
|
504
|
-
}
|